<?php
namespace Home\Model;
use Think\Model;


/**
* 
*/
class WebsitesModel extends Model
{
	/****
	logincheck()密码登陆验证
	$loginname登陆名称
	$passcheck登陆密码
	****/
	function logincheck($loginname,$password){
		$result=$this->where('loginaccount="'.$loginname.'" and password="'.$password.'"')->select();
		if(!empty($result)){
			$result=array('success'=>'0','msg'=>'登陆成功!');
		}else{
			$result=array('success'=>'1','msg'=>'账户或者密码有误!');
		}
		return $result;
	}

	/****
	accountcheck()检测账户是否存在
	$account账户名称
	****/
	public function accountcheck($account){
		$result=$this->where('loginaccount="'.$account.'"')->select();
		if(!empty($result)){
			$result=array('success'=>'0','msg'=>'账户存在!');
		}else{
			$result=array('success'=>'1','msg'=>'账户不存在!');
		}
		return $result;
	}

	/****
	addUser()
	****/
	public function addUser($content){
		$result=$this->data($content)->add();
		return $result;
	}
}
	